﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    CodeFile="DMVanChuyen.aspx.cs" Inherits="Admin_DanhMuc_DMVanChuyen" %>

<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc2" %>
<%@ Register Assembly="PagerControl" Namespace="CutePager" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .style1
        {
            color: #15428b;
            font-weight: bold;
            width: 99px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HomePlaceHolder" runat="Server">
    <script type="text/javascript">
        var GB_ROOT_DIR = "../../GREY_BOX/";
    </script>
    <script language="javascript" type="text/javascript">
        function Upload_HinhAnh() {
            var sFileName = document.getElementById('<%=H_AnhDaiDien.ClientID%>').value;
            var url = "../Admin/DanhMuc/UploadVanChuyen/UploadImage.aspx?sFileName=" + sFileName;
            return GB_showCenter('Tải ảnh đại diện', url, 220, 500);
        }
        function Insert_Image(imgPath, imgName) {
            document.getElementById('<%=imgViewer.ClientID%>').src = imgPath;
            document.getElementById('<%=H_AnhDaiDien.ClientID%>').value = imgName;
        } 
    </script>
    <script src="../../GREY_BOX/AJS.js" type="text/javascript"></script>
    <script src="../../GREY_BOX/AJS_fx.js" type="text/javascript"></script>
    <script src="../../GREY_BOX/gb_scripts.js" type="text/javascript"></script>
    <div class="hrm_header_placeholder">
        Danh mục Vận chuyển</div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="PanelAdd" Width="100%" GroupingText="Cập nhật thông tin" runat="server">
                <div style="float: right; left: 0; width: 20%;">
                    <table border="0" width="100%" align="right" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="100%" height="105" style="padding-left: 25px">
                                <asp:Image ID="imgViewer" ToolTip="Ảnh Đại Diện" runat="server" ImageUrl="~/Images/no_image.jpg"
                                    CssClass="imgviewer" onclick="JavaScript:Upload_HinhAnh()" Width="130" Height="105" />
                            </td>
                        </tr>
                        <tr>
                            <td style="padding: 5px">
                                &nbsp;&nbsp;(Kích vào hình để tải ảnh đại diện)
                            </td>
                        </tr>
                    </table>
                </div>
                <div style="padding: ; width: 80%;">
                    <asp:HiddenField ID="H_CatalogId" Value="0" runat="server" />
                    <asp:HiddenField ID="H_AnhDaiDien" Value="" runat="server" />
                    <table border="0" width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="20">
                            </td>
                            <td width="110" class="hrm_title_blue">
                            </td>
                            <td width="7" class="hrm_title_blue">
                            </td>
                            <td>
                                <asp:Label ID="lblStatus" ForeColor="Red" runat="server" Text=""></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" height="4">
                            </td>
                        </tr>
                        <tr>
                            <td width="20">
                            </td>
                            <td width="130" class="hrm_title_blue">
                                Tên xe
                            </td>
                            <td width="7" class="hrm_title_blue">
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="txtTenXe" CssClass="hrm_textbox" Width="300px" MaxLength="30" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" SetFocusOnError="True"
                                    ControlToValidate="txtTenXe" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" height="4">
                            </td>
                        </tr>
                        <tr>
                            <td width="20">
                            </td>
                            <td width="130" class="hrm_title_blue">
                                Nhà sản xuất
                            </td>
                            <td width="7" class="hrm_title_blue">
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="txtNhaSanXuat" CssClass="hrm_textbox" Width="300px" MaxLength="30"
                                    runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" SetFocusOnError="True"
                                    ControlToValidate="txtNhaSanXuat" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" height="4">
                            </td>
                        </tr>
                        <tr>
                            <td width="20">
                            </td>
                            <td width="130" class="hrm_title_blue">
                                Số chỗ
                            </td>
                            <td width="7" class="hrm_title_blue">
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="txtSoCho" CssClass="hrm_textbox" Width="300px" MaxLength="30" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" SetFocusOnError="True"
                                    ControlToValidate="txtSoCho" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" height="4">
                            </td>
                        </tr>
                        <tr>
                            <td width="20">
                            </td>
                            <td width="100" class="hrm_title_blue">
                                Trạng thái
                            </td>
                            <td width="7" class="hrm_title_blue">
                                :
                            </td>
                            <td>
                                <asp:CheckBox ID="chkTrangThai" Checked="true" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" height="4">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" height="4">
                            </td>
                        </tr>
                        <tr>
                            <td width="20">
                            </td>
                            <td width="110" class="hrm_title_blue">
                            </td>
                            <td width="7" class="hrm_title_blue">
                            </td>
                            <td>
                                <asp:ImageButton ID="cmdSave" ImageUrl="~/Images/save.jpg" runat="server" OnClick="cmdSave_Click" />
                                <asp:ImageButton ID="cmdReset" CausesValidation="false" ImageUrl="~/Images/huy.jpg"
                                    runat="server" OnClick="cmdReset_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" height="8">
                            </td>
                        </tr>
                    </table>
            </asp:Panel>
            <asp:Panel ID="PanelList" Width="100%" Height="355" GroupingText="Danh sách" runat="server">
                <table border="0" width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="20">
                        </td>
                        <td style="padding-right: 15px">
                            <asp:Panel ID="PanelGrid" Width="100%" runat="server">
                                <br />
                                <asp:GridView ID="gridCatalog" runat="server" DataKeyNames="Id" Width="100%" BackColor="White"
                                    OnRowCommand="gridCatalog_RowCommand" OnRowDataBound="gridCatalog_RowDataBound"
                                    OnRowDeleting="gridCatalog_RowDeleting" EmptyDataText="<br><center>Không tồn tại dữ liệu</center><br>"
                                    BorderColor="#CCCCCC" AutoGenerateColumns="false" BorderStyle="Solid" BorderWidth="1px"
                                    CellPadding="3">
                                    <Columns>
                                        <asp:BoundField DataField="id" Visible="false" HeaderText="id"></asp:BoundField>
                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            ItemStyle-Width="7%" HeaderText="Sửa">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="cmdSelects" runat="server" CssClass="command_button" CausesValidation="false"
                                                    CommandName="Select" ToolTip="Click để sửa" ImageUrl="~/Images/edit.png" CommandArgument='<%# Eval("id") %>' />
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" Width="7%" />
                                        </asp:TemplateField>
                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            ItemStyle-Width="7%" HeaderText="Xóa">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="cmdDelete" runat="server" CssClass="command_button" CausesValidation="false"
                                                    CommandName="Delete" ToolTip="Click để xóa" ImageUrl="~/Images/DeleteRed.png"
                                                    CommandArgument='<%# Eval("id") %>' />
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" Width="7%" />
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="TenXe" ItemStyle-Width="25%" HeaderText="Tên xe"></asp:BoundField>
                                        <asp:BoundField DataField="NhaSanXuat" ItemStyle-Width="25%" HeaderText="Nhà sản xuất">
                                        </asp:BoundField>
                                        <asp:BoundField DataField="SoCho" ItemStyle-Width="25%" HeaderText="Số chỗ"></asp:BoundField>
                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            HeaderText="Đã đăng" ItemStyle-Width="15%">
                                            <ItemTemplate>
                                                <asp:Label ID="LabelTinNong" runat="server" Text='<%# (Eval("TrangThai").ToString())=="True" ? "<html><img src=../../Images/checkk.png /></html>" : "<html><img src=../../Images/redx.png /></html>"%>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" Width="8%" />
                                        </asp:TemplateField>
                                    </Columns>
                                    <RowStyle ForeColor="#000066" />
                                    <SelectedRowStyle BackColor="#dedfdf" Font-Bold="True" ForeColor="Gray" />
                                    <HeaderStyle BackColor="#006699" Font-Bold="True" HorizontalAlign="Left" ForeColor="White" />
                                </asp:GridView>
                            </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" height="10">
                            <cc1:Pager ID="Pager1" runat="server" PreviousClause="" NextClause="" LastClause=""
                                FirstClause="" PageClause="Trang" OfClause="/" PageSize="10" OnCommand="Pager1_Command">
                            </cc1:Pager>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
